package com.bush.mall.order.controller;

import org.springframework.web.bind.annotation.*;
import com.bush.mall.common.entity.Result;;
import com.bush.mall.order.entity.PaymentInfoEntity;
import com.bush.mall.order.service.PaymentInfoService;
import javax.annotation.Resource;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;

/**
 * 支付信息表
 * @author RUN
 * @date 2022-11-29
 */
@RestController
@RequestMapping("paymentinfo")
@Api(tags = "支付信息表管理" )
public class PaymentInfoController {

    @Resource(name= PaymentInfoService.BEAN_ID)
    private PaymentInfoService paymentInfoService;

    /**
     * 分页查询支付信息表列表
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "分页查询支付信息表列表")
    @GetMapping("queryForPage")
    public Result queryForPage(Integer current,Integer size){
        return paymentInfoService.queryForPage(current,size);
    }

    /**
     * 保存支付信息表表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "保存支付信息表表单")
    @PostMapping
    public Result savePaymentInfo(@RequestBody PaymentInfoEntity paymentInfo){
        return paymentInfoService.savePaymentInfo(paymentInfo);
    }

    /**
     * 修改支付信息表表单
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "修改支付信息表表单")
    @PutMapping
    public Result updatePaymentInfo(@RequestBody PaymentInfoEntity paymentInfo){
        return paymentInfoService.updatePaymentInfo(paymentInfo);
    }

    /**
     * 通过指定id删除支付信息表
     * @author RUN
     * @date 2022-11-29
     */
    @ApiOperation(value = "通过指定id删除支付信息表")
    @DeleteMapping
    public Result deletePaymentInfo(Long id){
        return paymentInfoService.deletePaymentInfo(id);
    }

}
